home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
276
< prev
next >
Wrap
Text File
|
1996-08-06
|
3KB
|
55 lines
Newsgroups: comp.lang.c,comp.std.c
Path: in1.uu.net!world!mv!usenet
From: ENGR@GSSI.MV.COM (Michael Furman)
Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
Message-ID: <DM3wEy.FHH@mv.mv.com>
Mime-Version: 1.0
Organization: GSSI
Date: Thu, 1 Feb 1996 16:56:57 GMT
References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <TANMOY.96Jan29090518@qcd.lanl.gov>
X-Newsreader: WinVN 0.93.10
X-Nntp-Posting-Host: gssi.mv.com
In article <TANMOY.96Jan29090518@qcd.lanl.gov>, tanmoy@qcd.lanl.gov says...
>
>In article <KANZE.96Jan29121956@slsvewt.lts.sel.alcatel.de>
>kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
><snip>
> I think the crux of Michael Furman's question lies therein. Does the
> standard require a diagnostic if the function main is not of one of
> the two types given?
>
Not exactly. My question was not about diagnostics, but about usage
of constructions that are not defined in standard.
There are two kinds of undefined behavior:
1. When operation does not have any meaning. Example: assigning a value
to dereferenced incorrect pointer. In such cases sometimes it is very
hard or impossible (at least on some platforms) to check it even at
execution time and it is really possible that hard disk will be
reformatted as a result of such operations.
2. When operation has meaning but can not be portable defined for all
platforms. Example: all number conversions that depends on internal
representation or some CPU specific (like rounding). But I have more
clear example: "asm" keyword. I found it is defined in C++ draft and
I believe it is defined in C standard.
Was it inserted just to give programmers some way to implement undefined
behavior (with some chance to have disk reformatted)? I do not think so.
In C++ draft standard there are two words used in such cases:
"undefined behavior" and "implementation defined behavior" - and I think
they are used accordingly for 1. and 2. As I understand now in C standard
there is no such clear division. But it does not mean that the problem
does not exist and I believe it is very wrong to claim that in every
case where behavier is not defined by C standard we may loose all
data from our hard disk!
--
<<<<<<<< This is a copy of post to the newsgroup >>>>>>>>
---------------------------------------------------------------
Michael Furman, (603)893-1109
Geophysical Survey Systems, Inc. fax:(603)889-3984
13 Klein Drive - P.O. Box 97 engr@gssi.mv.com
North Salem, NH 03073-0097 71543.1334@compuserve.com
---------------------------------------------------------------